﻿using System;
public class Rect
{
    public double Width
    {
        get; set;
    }
    public double Height
        { get; set; }
    public Rect(double width, double height)
    {
        Width = width;
        Height = height;
    }
    public Rect() 
    { 
        Width = 10;
        Height = 10;
    }
    public double Area()
    {
        return Width * Height;
    }
    public double Perimeter()
    {
        return 2 * (Width + Height);
    }
}
public class PlainRect : Rect
{
    public double StartX { get; set; }
    public double StartY { get; set; }
    public PlainRect(double startX, double startY, double width, double height) : base(width, height)
    {
        StartX = startX;
        StartY = startY;
    }
    public PlainRect() : this(0, 0, 0, 0)
    {
    }
    public bool IsInside(double x, double y)
    {
        double endX = StartX + Width;
        double endY = StartY - Height; 

        return x >= StartX && x <= endX && y <= StartY && y >= endY;
    }
}
class Program
{
    static void Main(string[] args)
    {
        PlainRect rect = new PlainRect(10, 10, 20, 10);

        Console.WriteLine($"矩形面积: {rect.Area()}");
        Console.WriteLine($"矩形周长: {rect.Perimeter()}");

        double testX = 25.5;
        double testY = 13;
        bool isInside = rect.IsInside(testX, testY);
        Console.WriteLine($"点({testX}, {testY}) {(isInside ? "在" : "不在")}矩形内");

    }
}

